{include file="public/layout.htm" /}
<script>
    function changeTime(obj) {
        $(".title_right span").removeClass('active');
        $(obj).addClass('active');
        var val = $(obj).data('val');
        $.ajax({
            type: 'POST',
            url: "{:weapp_url('Mbackend/Mbackend/ajax_change_time')}",
            data: {time:val,_ajax:1},
            dataType: 'json',
            success: function(res) {
                console.log(res)
                $("#order_count").text(res.data.order_count);
                $("#order_amount_count").text(res.data.order_amount_count);
                $("#new_user_count").text(res.data.new_user_count);
                $("#click_count").text(res.data.click_count);
            },
            error:function (e) {
                layer.alert(e.responseText);
            }
        });
    }
</script>
<body class="bodystyle shop">
    <div class="my-content">
        <div class="shop_base_info color-base-bg">
            <div class="shop_info margin-left">
                <div class="shop_title">
                    <span class="name_pic">
                        <img src="{$admin_info.head_pic}">
                    </span>
                    <span class="user-name">{$admin_info.user_name}</span>
                    <span class="group-name color-base-text">{$admin_info.role_name}</span>
                </div>
            </div>
            <span class="weixincode"></span>
        </div>
        <div class="statistics-data">
            <div class="title">
                <div class="title_left">数据概况</div>
                <div class="title_right">
                    <span class="active" onclick="changeTime(this);" data-val="month">本月</span>
                    <span onclick="changeTime(this);" data-val="last_month">上月</span>
                    <span onclick="changeTime(this);" data-val="total">总计</span>
                </div>
            </div>
            <div class="content">
                <div>
                    <div class="color-tip">订单数</div>
                    <div class="num" id="order_count">{$count.order_count}</div>
                </div>
                <div>
                    <div class="color-tip">销售额（元）</div>
                    <div class="num" id="order_amount_count">{$count.order_amount_count}</div>
                </div>
                <div>
                    <div class="color-tip">新增会员数</div>
                    <div class="num" id="new_user_count">{$count.new_user_count}</div>
                </div>
                <div>
                    <div class="color-tip">浏览量</div>
                    <div class="num" id="click_count">{$count.click_count}</div>
                </div>
            </div>
        </div>
        <div class="trading_statistics">
            <div class="grid">
                <div class="grid-item">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Shop/index', ['order_status'=>10])}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/wating_pay.png">
                                </div>
                                {gt name="$count.wait_pay_count" value="0"}<span class="num">{$count.wait_pay_count}</span>{/gt}
                                <div class="text">待付款</div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="grid-item">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Shop/index', ['order_status'=>1])}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/wating_send.png">
                                </div>
                                {gt name="$count.send_goods_count" value="0"}<span class="num">{$count.send_goods_count}</span>{/gt}
                                <div class="text">待发货</div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="grid-item">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Shop/after_service')}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/return_money.png">
                                </div>
                                {gt name="$count.wait_service_count" value="0"}<span class="num">{$count.wait_service_count}</span>{/gt}
                                <div class="text">待售后</div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="grid-item">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/ShopProduct/index')}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/stock_warn.png">
                                </div>
                                <div class="text">全部商品</div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="grid-item">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/ShopProduct/index', ['query'=>3])}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/xiajia.png">
                                </div>
                                {gt name="$count.warming_count" value="0"}<span class="num">{$count.warming_count}</span>{/gt}
                                <div class="text">预警商品</div>
                            </div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        
        
        <div class="trading_statistics">
            <div class="grid">
                <!-- <div class="grid-item grid-item-function">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Archives/index_archives')}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/manage_good.png">
                                </div>
                                <div class="text">内容管理</div>
                            </div>
                        </div>
                    </a>
                </div> -->
                <div class="grid-item grid-item-function">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Shop/index')}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/manage_order.png">
                                </div>
                                <div class="text">订单管理</div>
                            </div>
                        </div>
                    </a>
                </div>
                <div class="grid-item grid-item-function">
                    <a class="grid-item-box" href="{:weapp_url('Mbackend/Member/users_index')}">
                        <div class="grid-item-box-item">
                            <div class="grid_item">
                                <div class="image">
                                    <img src="__WEAPP_TEMPLATE__/skin/images/member_card.png">
                                </div>
                                <div class="text">会员管理</div>
                            </div>
                        </div>
                    </a>
                </div>
                
            </div>
        </div>
        
        
    </div>
    <div class="my-footer-wrap">
        <div class="primary"><a href="{:url('Admin/logout', ['weappAjax'=>1, 'isMobile'=>1])}">退出登录</a></div>
    </div> 
</body>
{include file="public/footer.htm" /}